#ifndef LOGIC_DONE_H
#define LOGIC_DONE_H

#include <iostream>
#include <string>
#include <vector>

#include "Parser.h"
#include "Data.h"
#include "Task.h"
#include "Writer.h"

#include <boost\date_time.hpp>

using namespace std;
using namespace boost::posix_time;
using namespace boost::gregorian;

class LogicDone {
public:
	string doneByIndex(Parser::PARSED_COMMAND parsedCommand, 
							vector<Task>& tasksVector,
							Data* _data,
							Writer* _writer);

	string doneBySearchTerm(Parser::PARSED_COMMAND parsedCommand, 
							vector<Task>& tasksVector,
							Data* _data,
							Writer* _writer);

private:
	Task _task;

	static const string DONE_SUCCESS_MESSAGE;
	static const string UNDONE_SUCCESS_MESSAGE;

	static const string DONE_ERROR_MESSAGE;
	static const string DONE_MULTIPLE_MATCH_ERROR_MESSAGE;

	static const int FOUND_ONE_MATCH;
	static const int FIRST_POSITION;

	static const string NOT_FOUND_ERROR_MESSAGE;
	static const string INDEX_OUT_OF_BOUNDS_ERROR_MESSAGE;

	bool isOutOfBounds(int index, int size);
	void copyTasks(vector<Task>& tasks, vector<Task>& tasksVector);
};
#endif